---
sidebar_position: 1
---
import DefaultValues from '../../src/demos/defaultValues'

# Adding default values to columns

You can easily add default values to new rows using the `createRow` prop. You can also make sure duplicated rows
have default values using the `duplicateRow` prop.

Try adding rows, inserting rows (using `Shift+Enter`), or duplicating empty rows (using `Ctrl+D`):
<DefaultValues />

```tsx
<DataSheetGrid
  createRow={() => ({ age: 25, date: new Date() })}
  duplicateRow={({ rowData }) => ({
    ...rowData,
    age: rowData.int ?? 25,
    date: rowData.date ?? new Date(),
  })}
/>
```
